package com.example.demo.controller;

import com.example.demo.controller.data.ReturnData;
import com.example.demo.sevice.BannerService;
import org.springframework.boot.Banner;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@RestController
public class BannerController {
    @Resource
    BannerService bannerService;
    @GetMapping("/getBanner")
    public ReturnData getBanner() {
        return  bannerService.getBanner();
    }
    @PostMapping("/banner/add")
    public ReturnData addBanner(@RequestBody Banner banner){
        return bannerService.addBanner(banner);
    }
   @PostMapping("/banner/delete")
    public ReturnData deleteBanner(@RequestBody Banner banner){
        return bannerService.deleteBanner(banner.getClass());
   }

}
